package com.gmail.blackdog1987.onedollar.dao;

import com.gmail.blackdog1987.onedollar.dao.hibernate.EntityHibernateDao;
import com.gmail.blackdog1987.onedollar.dao.hibernate.jdbc.BaseJdbcDao;
import com.gmail.blackdog1987.onedollar.dao.hibernate.jdbc.JdbcUtil;
import com.gmail.blackdog1987.onedollar.entity.TGoodsJudgeEntity;
import com.gmail.blackdog1987.onedollar.entity.TGoodsShowLikeEntity;
import com.gmail.blackdog1987.onedollar.entity.base.Page;
import com.gmail.blackdog1987.onedollar.vo.GoodsJudgeVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository("goodsShowLikeDao")
public class GoodsShowLikeDao extends EntityHibernateDao<TGoodsShowLikeEntity>{
    @Autowired
    private BaseJdbcDao baseJdbcDao;
    public boolean isLiked(int userid, int showid){
        return baseJdbcDao.getJdbcTemplate().queryForInt(" SELECT COUNT(*) from t_goods_show_like where user_id = ? and show_id = ?", new Object[]{userid, showid})>0;
    }
}
